package wang.day7improtanlianxi;

public class lianxicopy {
    public static void main(String[] args) {
int[] arr={10,55,5165,51,231};

int[] copynew=copyOfRange(arr,1,4);
        for (int i = 0; i < copynew.length; i++) {
            System.out.println(copynew[i]);
        }

    }
    public static int[] copyOfRange(int[]arr,int from,int to){
        int[] newarr=new int[to-from];
        for (int i = 0; i < newarr.length ; i++) {
             newarr[i]=arr[i];

        }
    return  newarr;
    }
}
